home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / Balloons.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  9.0 KB  |  224 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Balloons.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __BALLOONS__
  13. #define __BALLOONS__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19. #ifndef __QUICKDRAW__
  20. #include <Quickdraw.h>
  21. #endif
  22.  
  23. #ifndef __MENUS__
  24. #include <Menus.h>
  25. #endif
  26.  
  27. #ifndef __TRAPS__
  28. #include <Traps.h>
  29. #endif
  30.  
  31.  
  32. enum {
  33.  
  34.  hmBalloonHelpVersion = 0x0002,            /* The real version of the Help Manager */
  35.  
  36. /*Help Mgr error range: -850 to -874*/
  37.  hmHelpDisabled = -850,                    /* Show Balloons mode was off, call to routine ignored */
  38.  hmBalloonAborted = -853,                /* Returned if mouse was moving or mouse wasn't in window port rect */
  39.  hmSameAsLastBalloon = -854,            /* Returned from HMShowMenuBalloon if menu & item is same as last time */
  40.  hmHelpManagerNotInited = -855,            /* Returned from HMGetHelpMenuHandle if help menu not setup */
  41.  hmSkippedBalloon = -857,                /* Returned from calls if helpmsg specified a skip balloon */
  42.  hmWrongVersion = -858,                    /* Returned if help mgr resource was the wrong version */
  43.  hmUnknownHelpType = -859,                /* Returned if help msg record contained a bad type */
  44.  hmOperationUnsupported = -861,            /* Returned from HMShowBalloon call if bad method passed to routine */
  45.  hmNoBalloonUp = -862,                    /* Returned from HMRemoveBalloon if no balloon was visible when call was made */
  46.  hmCloseViewActive = -863,                /* Returned from HMRemoveBalloon if CloseView was active */
  47.  
  48.  kHMHelpMenuID = -16490,                /* Resource ID and menu ID of help menu */
  49.  kHMAboutHelpItem = 1,                    /* help menu item number of About Balloon Help… */
  50.  kHMShowBalloonsItem = 3,                /* help menu item number of Show/Hide Balloons */
  51.  
  52.  kHMHelpID = -5696,                        /* ID of various Help Mgr package resources (in Pack14 range) */
  53.  kBalloonWDEFID = 126,                    /* Resource ID of the WDEF proc used in standard balloons */
  54.  
  55. /* Dialog item template type constant */
  56.  helpItem = 1,                            /* key value in DITL template that corresponds to the help item */
  57.  
  58. /* Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources */
  59.  hmDefaultOptions = 0,                    /* default options for help manager resources */
  60.  hmUseSubID = 1,                        /* treat resID's in resources as subID's of driver base ID (for Desk Accessories) */
  61.  hmAbsoluteCoords = 2                    /* ignore window port origin and treat rectangles as absolute coords (local to window) */
  62. };
  63. enum {
  64.  hmSaveBitsNoWindow = 4,                /* don't create a window, just blast bits on screen. No update event is generated */
  65.  hmSaveBitsWindow = 8,                    /* create a window, but restore bits behind window when window goes away & generate update event */
  66.  hmMatchInTitle = 16,                    /* for hwin resources, match string anywhere in window title string */
  67.  
  68. /* Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources */
  69.  kHMStringItem = 1,                        /* pstring used in resource */
  70.  kHMPictItem = 2,                        /* 'PICT' ResID used in resource */
  71.  kHMStringResItem = 3,                    /* 'STR#' ResID & index used in resource */
  72.  kHMTEResItem = 6,                        /* Styled Text Edit ResID used in resource ('TEXT' & 'styl') */
  73.  kHMSTRResItem = 7,                        /* 'STR ' ResID used in resource */
  74.  kHMSkipItem = 256,                        /* don't display a balloon */
  75.  kHMCompareItem = 512,                    /* Compare pstring in menu item w/ PString in resource item ('hmnu' only) */
  76.  kHMNamedResourceItem = 1024,            /* Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) */
  77.  kHMTrackCntlItem = 2048,                /* Reserved */
  78.  
  79. /* Constants for hmmHelpType's when filling out HMMessageRecord */
  80.  khmmString = 1,                        /* help message contains a PString */
  81.  khmmPict = 2,                            /* help message contains a resource ID to a 'PICT' resource */
  82.  khmmStringRes = 3,                        /* help message contains a res ID & index to a 'STR#' resource */
  83.  khmmTEHandle = 4,                        /* help message contains a Text Edit handle */
  84.  khmmPictHandle = 5,                    /* help message contains a Picture handle */
  85.  khmmTERes = 6,                            /* help message contains a res ID to 'TEXT' & 'styl' resources */
  86.  khmmSTRRes = 7,                        /* help message contains a res ID to a 'STR ' resource */
  87.  
  88. /* ResTypes for Styled TE Handles in Resources */
  89.  
  90. #define kHMTETextResType 'TEXT'            /* Resource Type of text data for styled TE record w/o style info */
  91. #define kHMTEStyleResType 'styl'        /* Resource Type of style information for styled TE record */
  92.  
  93. /* Generic defines for the state parameter used when extracting 'hmnu' & 'hdlg' messages */
  94.  
  95.  kHMEnabledItem = 0                        /* item is enabled, but not checked or control value = 0 */
  96. };
  97. enum {
  98.  kHMDisabledItem = 1,                    /* item is disabled, grayed in menus or disabled in dialogs */
  99.  kHMCheckedItem = 2,                    /* item is enabled, and checked or control value = 1 */
  100.  kHMOtherItem = 3,                        /* item is enabled, and control value > 1 */
  101.  
  102. /* Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages */
  103.  
  104. #define kHMMenuResType 'hmnu'            /* ResType of help resource for supporting menus */
  105. #define kHMDialogResType 'hdlg'            /* ResType of help resource for supporting dialogs */
  106. #define kHMWindListResType 'hwin'        /* ResType of help resource for supporting windows */
  107. #define kHMRectListResType 'hrct'        /* ResType of help resource for rectangles in windows */
  108. #define kHMOverrideResType 'hovr'        /* ResType of help resource for overriding system balloons */
  109. #define kHMFinderApplResType 'hfdr'        /* ResType of help resource for custom balloon in Finder */
  110.  
  111. /* Method parameters to pass to HMShowBalloon */
  112.  
  113.  kHMRegularWindow = 0,                    /* Create a regular window floating above all windows */
  114.  kHMSaveBitsNoWindow = 1,                /* Just save the bits and draw (for MDEF calls) */
  115.  kHMSaveBitsWindow = 2                    /* Regular window, save bits behind, AND generate update event */
  116. };
  117.  
  118. struct HMStringResType {
  119.  short hmmResID;
  120.  short hmmIndex;
  121. };
  122.  
  123. typedef struct HMStringResType HMStringResType;
  124.  
  125. struct HMMessageRecord {
  126.  short hmmHelpType;
  127.  union {
  128.   char hmmString[256];
  129.   short hmmPict;
  130.   Handle hmmTEHandle;
  131.   HMStringResType hmmStringRes;
  132.   short hmmPictRes;
  133.   Handle hmmPictHandle;
  134.   short hmmTERes;
  135.   short hmmSTRRes;
  136.   } u;
  137. };
  138.  
  139. typedef struct HMMessageRecord HMMessageRecord;
  140. typedef HMMessageRecord *HMMessageRecPtr;
  141.  
  142.  
  143. #ifdef __cplusplus
  144. extern "C" {
  145. #endif
  146. /*  Public Interfaces  */
  147. pascal OSErr HMGetHelpMenuHandle(MenuHandle *mh)
  148.  = {0x303C,0x0200,_Pack14}; 
  149. pascal OSErr HMShowBalloon(const HMMessageRecord *aHelpMsg,
  150.                            Point tip,
  151.                            RectPtr alternateRect,
  152.                            Ptr tipProc,
  153.                            short theProc,
  154.                            short variant,
  155.                            short method)
  156.  = {0x303C,0x0B01,_Pack14}; 
  157. pascal OSErr HMRemoveBalloon(void)
  158.  = {0x303C,0x0002,_Pack14}; 
  159. pascal Boolean HMGetBalloons(void)
  160.  = {0x303C,0x0003,_Pack14}; 
  161. pascal OSErr HMSetBalloons(Boolean flag)
  162.  = {0x303C,0x0104,_Pack14}; 
  163. pascal OSErr HMShowMenuBalloon(short itemNum,
  164.                                short itemMenuID,
  165.                                long itemFlags,
  166.                                long itemReserved,
  167.                                Point tip,
  168.                                RectPtr alternateRect,
  169.                                Ptr tipProc,
  170.                                short theProc,
  171.                                short variant)
  172.  = {0x303C,0x0E05,_Pack14}; 
  173. pascal OSErr HMGetIndHelpMsg(ResType whichType,
  174.                              short whichResID,
  175.                              short whichMsg,
  176.                              short whichState,
  177.                              long *options,
  178.                              Point *tip,
  179.                              Rect *altRect,
  180.                              short *theProc,
  181.                              short *variant,
  182.                              HMMessageRecord *aHelpMsg,
  183.                              short *count)
  184.  = {0x303C,0x1306,_Pack14}; 
  185. pascal Boolean HMIsBalloon(void)
  186.  = {0x303C,0x0007,_Pack14}; 
  187. pascal OSErr HMSetFont(short font)
  188.  = {0x303C,0x0108,_Pack14}; 
  189. pascal OSErr HMSetFontSize(short fontSize)
  190.  = {0x303C,0x0109,_Pack14}; 
  191. pascal OSErr HMGetFont(short *font)
  192.  = {0x303C,0x020A,_Pack14}; 
  193. pascal OSErr HMGetFontSize(short *fontSize)
  194.  = {0x303C,0x020B,_Pack14}; 
  195. pascal OSErr HMSetDialogResID(short resID)
  196.  = {0x303C,0x010C,_Pack14}; 
  197. pascal OSErr HMSetMenuResID(short menuID,
  198.                             short resID)
  199.  = {0x303C,0x020D,_Pack14}; 
  200. pascal OSErr HMBalloonRect(const HMMessageRecord *aHelpMsg,
  201.                            Rect *coolRect)
  202.  = {0x303C,0x040E,_Pack14}; 
  203. pascal OSErr HMBalloonPict(const HMMessageRecord *aHelpMsg,
  204.                            PicHandle *coolPict)
  205.  = {0x303C,0x040F,_Pack14}; 
  206. pascal OSErr HMScanTemplateItems(short whichID,
  207.                                  short whichResFile,
  208.                                  ResType whichType)
  209.  = {0x303C,0x0410,_Pack14}; 
  210. pascal OSErr HMExtractHelpMsg(ResType whichType,short whichResID,short whichMsg,
  211.  short whichState,HMMessageRecord *aHelpMsg)
  212.  = {0x303C,0x0711,_Pack14}; 
  213. pascal OSErr HMGetDialogResID(short *resID)
  214.  = {0x303C,0x0213,_Pack14}; 
  215. pascal OSErr HMGetMenuResID(short menuID,short *resID)
  216.  = {0x303C,0x0314,_Pack14}; 
  217. pascal OSErr HMGetBalloonWindow(WindowPtr *window)
  218.  = {0x303C,0x0215,_Pack14}; 
  219. #ifdef __cplusplus
  220. }
  221. #endif
  222.  
  223. #endif
  224.